class Container {
    constructor(value) {
        this.value = value
    }

    static of(value) {
        return new Container(value)
    }

    map(fn) {
        return Container.of(fn(this.value))
    }
}


let result = new Container(6)
    .map(x => x + 6).map(x => x * x)
let result2 = Container.of(6)
    .map(x => x + 2).map(x => x * x)

Container.of(6).map((x) => {
    console.log(x)
})

console.log(result)
console.log(result2)
